package com.prjsystem.action;

import java.util.List;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.prjsystem.common.constant.CMSConstant;
import com.prjsystem.entity.MenuBean;
import com.prjsystem.entity.UserInfo;
import com.prjsystem.service.TopMenuService;

@SuppressWarnings("serial")
public class TopMenuAction extends ActionSupport {
	private TopMenuService topMenuService;
	private List<MenuBean> menuList;

	// 用户成功登陆
	public String init() throws Exception {
		ActionContext ctx = ActionContext.getContext();
		UserInfo user = (UserInfo)ctx.getSession().get(CMSConstant.USERINFO);
		menuList = topMenuService.getTopMenuList(user.getRoleid());
		return SUCCESS;
	}

	public String error() {
		return ERROR;
	}
	public List<MenuBean> getMenuList() {
		return menuList;
	}
	public void setMenuList(List<MenuBean> menuList) {
		this.menuList = menuList;
	}
	public TopMenuService getTopMenuService() {
		return topMenuService;
	}
	public void setTopMenuService(TopMenuService topMenuService) {
		this.topMenuService = topMenuService;
	}
}


